package com.deep.order.service.impl;

import com.deep.order.feign.MemberFeignService;
import com.deep.order.model.vo.FareVO;
import com.deep.order.model.vo.MemberAddressVO;
import com.deep.order.service.FareService;
import com.deep.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;

import java.math.BigDecimal;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author Deep
 * @date 2022/2/15
 */
@Service
public class FareServiceImpl implements FareService {
    @Autowired
    private MemberFeignService memberFeignService;

    @Autowired
    private OrderService orderService;

    @Override
    public FareVO getFare(Long addrId) {
        Assert.notNull(addrId, "addrId不能为空!");

        FareVO fareVO = new FareVO();
        MemberAddressVO address = memberFeignService.getAddressById(addrId);

        fareVO.setAddress(address);
        fareVO.setFare(new BigDecimal(10L));
        return fareVO;
    }
}
